package com.mbatis.juc.queen.bq;

import java.util.concurrent.BlockingDeque;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.SynchronousQueue;

/**
 *
 *
 * 同步队列
 *
 * 没有容量，
 * 进去一个元素，必须等待取出来之后，才能往里面放一个元素
 *
 */
public class SynchronousQueueDemo {

    public static void main(String[] args) {
        BlockingQueue<String> blockingQueue = new SynchronousQueue<>();

        new Thread(() -> {
            System.out.println(Thread.currentThread().getName()+"");
        }).start();
    }
}
